package com.xiang.sql.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 上传文件 数据实体
 * 
 * @author mac-xiang
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName(value = "`upload`", autoResultMap = true)
@ApiModel(value = "Upload对象", description = "上传文件")
public class Upload implements Serializable {

  private static final long serialVersionUID = 1L;

  @TableId(value = "id", type = IdType.ASSIGN_ID)
  public String id;

  /** 上传时间 */
  @TableField(value = "`create_time`", fill = FieldFill.INSERT)
  public Long createTime;

  /** 创建者 */
  @TableField(value = "`user`")
  public String user;

  /** 名称 */
  @TableField(value = "`name`", fill = FieldFill.INSERT)
  public String name;

  /** 分类 */
  @TableField(value = "`type`", fill = FieldFill.INSERT)
  public String type;

  /** 地址 */
  @TableField(value = "`path`")
  public String path;

  /** 其他内容 */
  @TableField(value = "`other`", fill = FieldFill.INSERT)
  public String other;

  public Upload() {
  }

  public Upload(String create, String type, String name, String path, String other) {
    this.user = create;
    this.name = name;
    this.type = type;
    this.path = path;
    this.other = other == null ? "{}" : other;
  }
}